<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <title>置换IPFS矿机</title>
    <link rel="stylesheet" href="../../css/reset.css" />
    <style>
        body {
            width: 100%;
            background-color: #F8F8F8;
            font-family: Helvetica;
            color: #333333;
            font-size: 0.28rem;
            /* font-family: "pingfangSC", serif; */
            font-family: PingFang SC;
        }

        .stepone {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-top: 0.3rem;
        }

        .stepone b {
            width: 100%;
            font-size: 0.3rem;
        }

        .stepone>p {
            font-size: 0.24rem;
            font-weight: 500;
            color: rgba(153, 153, 153, 1);
            margin: 0.1rem 0 0.13rem 0;
        }

        .stepone>div {
            width: 100%;
            height: 1rem;
            background: rgba(255, 209, 3, 1);
            box-shadow: 0px 0.06rem 0.29rem 0px rgba(255, 209, 3, 0.21);
            border-radius: 0.12rem;
            display: flex;
            display: -webkit-flex;
            align-items: stretch;
            justify-content: space-between;
            padding: 0 0.28rem;
            box-sizing: border-box;
        }

        .stepone>div p {
            display: flex;
            display: -webkit-flex;
            align-items: center;
            font-size: 0.28rem;
        }

        .stepone>div span {
            font-size: 0.24rem;
        }

        .stepone>div img {
            width: 0.15rem;
            margin-left: 0.1rem;
        }

        .couponListBox {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            justify-content: flex-start;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-top: 0.1rem;
            min-height: 6rem;
        }

        .couponListBox>li {
            margin-bottom: 0.2rem;
            border-radius: 0.1rem;
            overflow: hidden;
        }

        .couponListBox>li>div {
            display: block;
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: space-between;
            background-color: #fff;
            box-sizing: border-box;
            padding: 0.27rem 0;
        }

        input[name="machineList"] {
            width: 0.36rem;
            height: 0.36rem;
            background-color: #fff;
            -webkit-appearance: none;
            border: 1px solid #c9c9c9;
            outline: none;
            border-radius: 50%;
        }

        input[name="machineList"]:checked {
            width: 0.36rem;
            height: 0.36rem;
            background: url("../../image/iconxuangousuanlibao.png")no-repeat center;
            background-size: 100% 100%;
        }

        .machineName {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.24rem;
            box-sizing: border-box;
            margin-bottom: 0.18rem;
        }

        .machineName p {
            width: auto;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .machineName p:last-of-type {
            width: 1.16rem;
            height: 0.42rem;
            background: rgba(255, 255, 255, 1);
            border: 1px solid rgba(220, 220, 220, 1);
            border-radius: 0.22rem;
            font-size: 0.22rem;
            font-weight: 500;
            color: rgba(153, 153, 153, 1);
            justify-content: center;
        }

        .machineName .machineText {
            font-size: 0.28rem;
            font-weight: 500;
            color: rgba(38, 38, 38, 1);
            margin-left: 0.1rem;
        }

        .machineName p label {
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .machineIcon {
            width: 100%;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-start;
            position: relative;
            margin-bottom: 0.18rem;
            padding: 0 0.24rem;
            box-sizing: border-box;
        }

        .machineIcon span {
            display: inline-block;
            height: 0.34rem;
            line-height: 0.34rem;
            text-align: center;
            background-color: #FDEDEC;
            border-radius: 0.04rem;
            color: #E42E2E;
            padding: 0 0.12rem;
            font-size: 0.2rem;
        }

        .showEndNum {
            position: absolute;
            top: -0.67rem;
            right: 26%;
            width: 1.13rem;
        }

        .showNoreturn {
            height: 0.34rem;
            margin-left: 0.1rem;
        }

        .machineDetail {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            box-sizing: border-box;
            padding: 0 0.24rem;
        }

        .machineDetail>li {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.1rem;
            font-size: 0.24rem;
            color: #999999;
        }

        .machineDetail>li>p>span:last-of-type {
            color: #595959;
        }

        .machineDetail>li>p:last-of-type {
            width: 2.3rem;
        }

        .machineDetail>li:first-of-type>p .payMonenyNum {
            color: #F67311;
        }

        .machineDetail>li>p span:first-of-type {
            margin-right: 0.1rem;
        }

        .scriptureMachine {
            width: 100%;
            height: auto;
            padding: 0 0.24rem;
            box-sizing: border-box;
            margin-top: 0.1rem;
        }

        .scriptureMachine div {
            width: 100%;
            height: 0.64rem;
            background-color: #F8F8F8;
            border-radius: .1rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 0.2rem;
            font-size: 0.24rem;
            color: #999999;
        }

        .scriptureMachine div span {
            color: #595959;
        }

        .changeChoose {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 0.24rem;
            box-sizing: border-box;
            border-top: 1px solid #EEEEEE;
            padding-top: 0.18rem;
            margin-top: 0.2rem;
        }

        .changeChoose div {
            width: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-end;
        }

        .chooseNum {
            width: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
        }

        .chooseNum span {
            display: block;
            width: 0.44rem;
            height: 0.44rem;
            background: rgba(238, 238, 238, 1);
            border-radius: 0.08rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.26rem;
        }

        .chooseNum input {
            outline: none;
            border: none;
            display: block;
            width: 0.74rem;
            height: 0.4rem;
            background: rgba(238, 238, 238, 1);
            border-radius: 0.04rem;
            margin: 0 0.1rem;
            text-align: center;
            font-size: 0.28rem;
        }

        .changeChoose .moneyDischare {
            font-size: 0.2rem;
            color: #FF6E3C;
            margin-right: 0.18rem;
        }

        .changeChoose>p {
            font-size: 0.26rem;
            font-weight: 500;
            color: rgba(89, 89, 89, 1);
        }

        .fixedButtom {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            position: fixed;
            bottom: 0;
            left: 0;
        }

        .ipfsChangeText {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            background-color: #fff;
            border-radius: 0.25rem 0.25rem 0 0;
            overflow: hidden;
            padding-top: 0.3rem;
            border-bottom: 1px solid rgba(229, 229, 229, 1);
        }

        .ipfsChangeText li {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-bottom: 0.2rem;
            font-size: 0.26rem;
            font-weight: 500;
            color: rgba(153, 153, 153, 1);
        }

        .ipfsChangeText li>p:last-of-type {
            color: #FF6E3C;
        }

        .ipfsChangeText li:first-of-type>p:last-of-type,
        .ipfsChangeText li:nth-of-type(2)>p:last-of-type {
            color: #262626;
        }

        .submitMessage {
            width: 100%;
            height: 2.8rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            background-color: #fff;
            justify-content: center;
            padding: 0 0.3rem;
            box-sizing: border-box;
            font-size: 0.26rem;
        }

        .submitMessage>p {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-start;
            margin-bottom: 0.1rem;
        }

        .submitMessage>p:first-of-type {
            justify-content: flex-end;
            color: rgba(153, 153, 153, 1);
        }

        .submitMessage>p:not(:first-of-type) span {
            color: #5B9FF3;
        }

        .submitMessage>p:first-of-type img {
            width: 0.23rem;
            margin-left: 0.1rem;
        }

        input[name="chackArgee"] {
            width: 0.36rem;
            height: 0.36rem;
            background-color: #fff;
            -webkit-appearance: none;
            border: 1px solid #c9c9c9;
            outline: none;
            border-radius: 2px;
            margin-right: .1rem;
        }

        input[name="chackArgee"]:checked {
            width: 0.36rem;
            height: 0.36rem;
            background: url("../../image/checked.png")no-repeat center;
            background-size: 100% 100%;
            border: none;
        }

        .boxStyele {
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .submitButton {
            height: 0.82rem;
            background: rgba(255, 210, 3, 1);
            border-radius: 0.16rem;
            outline: none;
            border: none;
            color: #282828;
            font-size: 0.28rem;
        }

        .notClick {
            background: #D0D0D0;
            color: #ffffff;
        }

        .rotatedeg {
            transform: rotate(0);
            -webkit-transform: rotate(0);
            transition: all .1s linear;
            -webkit-transition: all .1s linear;
        }

        .rotate {
            transform: rotate(180deg);
            transition: all .3s linear;
            -webkit-transform: rotate(180deg);
            -webkit-transtion: all .1s linear;
        }

        .chooseConatrant {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-top: 0.16rem;
        }

        /* ***********************BTC高波置换*************************** */
        .hightBtcBox {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            justify-content: flex-start;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-top: 0.1rem;
            min-height: 6rem;
        }

        .hightBtcBox>li {
            margin-bottom: 0.2rem;
            border-radius: 0.1rem;
            overflow: hidden;
        }

        .hightBtcBox>li>div {
            display: block;
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: space-between;
            background-color: #fff;
            box-sizing: border-box;
            padding: 0.27rem 0;
        }

        input[name="hightMachine"] {
            width: 0.36rem;
            height: 0.36rem;
            background-color: #fff;
            -webkit-appearance: none;
            border: 1px solid #c9c9c9;
            outline: none;
            border-radius: 50%;
        }

        input[name="hightMachine"]:checked {
            width: 0.36rem;
            height: 0.36rem;
            background: url("../../image/iconxuangousuanlibao.png")no-repeat center;
            background-size: 100% 100%;
        }

        .lowerName {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.24rem;
            box-sizing: border-box;
            margin-bottom: 0.18rem;
        }

        .lowerName p {
            width: auto;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .lowerName p:last-of-type {
            width: 1.16rem;
            height: 0.42rem;
            background: rgba(255, 255, 255, 1);
            font-size: 0.22rem;
            font-weight: 500;
            color: rgba(153, 153, 153, 1);
            justify-content: center;
        }

        .lowerName .machineText {
            font-size: 0.28rem;
            font-weight: 500;
            color: rgba(38, 38, 38, 1);
            margin-left: 0.1rem;
        }

        .lowerName p label {
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .machineIconnew {
            width: 100%;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-start;
            position: relative;
            margin-bottom: 0.18rem;
            padding: 0 0.24rem;
            box-sizing: border-box;
        }

        .machineIconnew span {
            display: inline-block;
            height: 0.34rem;
            line-height: 0.34rem;
            text-align: center;
            background-color: #FDEDEC;
            border-radius: 0.04rem;
            color: #E42E2E;
            padding: 0 0.12rem;
            font-size: 0.2rem;
        }

        .showEndNumnew {
            position: absolute;
            top: -0.67rem;
            right: 6%;
            width: 1.13rem;
        }

        .showNoreturn {
            height: 0.34rem;
            margin-left: 0.1rem;
        }

        .machineDetailnew {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            box-sizing: border-box;
            padding: 0 0.24rem;
        }

        .machineDetailnew>li {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.1rem;
            font-size: 0.24rem;
            color: #999999;
        }

        .machineDetailnew>li>p>span:last-of-type {
            color: #595959;
        }

        .machineDetailnew>li>p:last-of-type {
            width: 3rem;
        }

        .machineDetailnew>li>p span:first-of-type {
            margin-right: 0.1rem;
        }

        .scriptureMachinenew {
            width: 100%;
            height: auto;
            padding: 0 0.24rem;
            box-sizing: border-box;
            margin-top: 0.1rem;
        }

        .scriptureMachinenew div {
            width: 100%;
            height: 0.64rem;
            background-color: #F8F8F8;
            border-radius: .1rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 0.2rem;
            font-size: 0.24rem;
            color: #999999;
        }

        .scriptureMachinenew div span {
            color: #595959;
        }

        .changeChoosenew {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 0.24rem;
            box-sizing: border-box;
            border-top: 1px solid #EEEEEE;
            padding-top: 0.18rem;
            margin-top: 0.2rem;
        }

        .changeChoosenew div {
            width: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-end;
        }

        .chooseNumnew {
            width: auto;
            display: flex;
            display: -webkit-flex;
            align-items: stretch;
            justify-content: center;
        }

        .chooseNumnew span {
            display: block;
            width: 0.44rem;
            background: rgba(238, 238, 238, 1);
            border-radius: 0.08rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.26rem;
        }

        .chooseNumnew input {
            outline: none;
            border: none;
            display: block;
            width: 0.74rem;
            background: rgba(238, 238, 238, 1);
            border-radius: 0.04rem;
            margin: 0 0.1rem;
            text-align: center;
            font-size: 0.28rem;
        }

        .changeChoosenew .moneyDischare {
            font-size: 0.2rem;
            color: #FF6E3C;
            margin-right: 0.18rem;
        }

        .changeChoosenew>p {
            font-size: 0.26rem;
            font-weight: 500;
            color: rgba(89, 89, 89, 1);
        }

        .inputChecked+label::before {
            content: " ";
            display: inline-block;
            width: 0.4rem;
            height: 0.4rem;
            box-sizing: border-box;
            background: url("../../image/checkimng.png") center center no-repeat;
            background-size: 100% 100%;
            padding: .1rem;
            border-radius: 0.03rem;
            margin-right: 0.1rem;
        }

        .inputChecked:checked+label::before {
            display: inline-block;
            width: 0.4rem;
            height: 0.4rem;
            box-sizing: border-box;
            background: url("../../image/iconxuangousuanlibao.png") center center no-repeat;
            background-size: 100% 100%;
            padding: .1rem;
            border: none;
            border-radius: 0.03rem;
            margin-right: 0.1rem;
        }

        .inputChecked {
            position: absolute;
            clip: rect(0, 0, 0, 0);
        }

        .inputBox {
            width: 100%;
            height: auto;
            position: relative;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-start;
        }

        .showsuanlibao {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
        }

        .showsuanlibao label {
            padding: 0 0 0 0.24rem;
            box-sizing: border-box;
            position: relative;
            width: auto;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            font-size: 0.24rem;
            color: #262626;

        }

        .fixedButtomnew {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            position: fixed;
            bottom: 0;
            left: 0;
        }

        .ipfsChangeTextnew {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            background-color: #fff;
            border-radius: 0.25rem 0.25rem 0 0;
            overflow: hidden;
            padding-top: 0.3rem;
            border-bottom: 1px solid rgba(229, 229, 229, 1);
        }

        .ipfsChangeTextnew li {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-bottom: 0.2rem;
            font-size: 0.26rem;
            font-weight: 500;
            color: rgba(153, 153, 153, 1);
        }

        .ipfsChangeTextnew li>p:last-of-type {
            color: #FF6E3C;
        }

        .ipfsChangeTextnew li:first-of-type>p:last-of-type,
        .ipfsChangeTextnew li:nth-of-type(2)>p:last-of-type,
        .ipfsChangeTextnew li:nth-of-type(3)>p:last-of-type {
            color: #262626;
        }

        .submitMessagenew {
            width: 100%;
            height: 2.8rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            background-color: #fff;
            justify-content: center;
            padding: 0 0.3rem;
            box-sizing: border-box;
            font-size: 0.26rem;
        }

        .submitMessagenew>p {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-start;
            margin-bottom: 0.1rem;
        }

        .submitMessagenew>p:first-of-type {
            justify-content: flex-end;
            color: rgba(153, 153, 153, 1);
        }

        .submitMessagenew>p:not(:first-of-type) span {
            color: #5B9FF3;
        }

        .submitMessagenew>p:first-of-type img {
            width: 0.23rem;
            margin-left: 0.1rem;
        }

        input[name="chackArgee"] {
            width: 0.36rem;
            height: 0.36rem;
            background-color: #fff;
            -webkit-appearance: none;
            border: 1px solid #c9c9c9;
            outline: none;
            border-radius: 2px;
            margin-right: .1rem;
        }

        input[name="chackArgee"]:checked {
            width: 0.36rem;
            height: 0.36rem;
            background: url("../../image/checked.png")no-repeat center;
            background-size: 100% 100%;
            border: none;
        }

        .boxStyele {
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .submitButton {
            height: 0.82rem;
            background: rgba(255, 210, 3, 1);
            border-radius: 0.16rem;
            outline: none;
            border: none;
            color: #282828;
            font-size: 0.28rem;
        }

        .submitButtonNew {
            height: 0.82rem;
            background: rgba(255, 210, 3, 1);
            border-radius: 0.16rem;
            outline: none;
            border: none;
            color: #282828;
            font-size: 0.28rem;
        }

        .notClick {
            background: #D0D0D0;
            color: #ffffff;
        }

        .rotatedeg {
            transform: rotate(0);
            -webkit-transform: rotate(0);
            transition: all .1s linear;
            -webkit-transition: all .1s linear;
        }

        .rotate {
            transform: rotate(180deg);
            transition: all .3s linear;
            -webkit-transform: rotate(180deg);
            -webkit-transtion: all .1s linear;
        }

        .chooseConatrant {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0.3rem;
            box-sizing: border-box;
            margin-top: 0.16rem;
        }

        .chooseConatrant p {
            width: 3.3rem;
            height: 1rem;
            background-color: #f8f8f8;
            border-radius: 0.12rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #999999;
            font-size: 0.28rem;
            color: #666666;
        }

        .chooseConatrant .checkP {
            border-color: #ffd203;
            background-color: #ffd203;
            color: #262626;
        }
    </style>
</head>

<body>
    <div class="stepone">
        <b>
            STEP1
        </b>
        <p>
            选择可用于置换的经典BTC合约包
        </p>
        <div class="isShowBox" style="display: none;">
            <p>
                BTC合约包
            </p>
            <p class="goChooseBtc">
                <span class="changBtcMoney">
                    暂未选择
                </span>
                <img src="../../image/right_jintoux.png" alt="">
            </p>
        </div>
    </div>
    <div class="stepone">
        <b>
            STEP2
        </b>
        <p>
            选择想置换的合约类型
        </p>
    </div>
    <div class="chooseConatrant">
        <p class="checkP" data-name="ipfsChange">
            IPFS合约
        </p>
        <p data-name="hightBtcchange">
            高波BTC合约
        </p>
    </div>
    <div class="hidebox ipfsChange">
        <ul class="couponListBox" style="padding-bottom: 5.6rem;">
            <!-- <li>
                <div>
                    <div class="machineName">
                        <p>
                            <label for="chooseInput">
                                <input type="checkbox" name="machineList" id="chooseInput">
                                <span class="machineText">
                                    IPFS云算力(1T)
                                </span>
                            </label>
                        </p>
                        <p class="knowMore">
                            了解更多
                        </p>
                    </div>
                    <p class="machineIcon">
                        <span>
                            头矿红利
                        </span>
                        <img src="../../image/iconyishouqinax.png" alt="已售罄" class="showEndNum">
                    </p>
                    <ul class="machineDetail">
                        <li>
                            <p>
                                <span>
                                    单份金额:
                                </span>
                                <span class="payMonenyNum">
                                    1000 <span style="font-size: 0.18rem;">CNY/</span> 200 <span
                                        style="font-size: 0.18rem;">USDT</span>
                                </span>
                            </p>
                            <p>
                                <span>
                                    单份存力:
                                </span>
                                <span>
                                    1 TB
                                </span>
                            </p>
                        </li>
                        <li>
                            <p>
                                <span>
                                    合约周期:
                                </span>
                                <span>
                                    720天
                                </span>
                            </p>
                            <p>
                                <span>
                                    剩余份额:
                                </span>
                                <span>
                                    XXX 份
                                </span>
                            </p>
                        </li>
                        <li>
                            <p>
                                <span>
                                    开挖时间:
                                </span>
                                <span>
                                    以IPFS官方通知为准
                                </span>
                            </p>
                            <p>
                                <span>
                                    分币比例:
                                </span>
                                <span>
                                    75%
                                </span>
                            </p>
                        </li>
                    </ul>
                    <div class="scriptureMachine">
                        <div>
                            <p>
                                赠送经典BTC: <span>xxT</span>
                            </p>
                            <p>
                                开挖时间: <span>2020 6-19 00:00:00</span>
                            </p>
                        </div>
                    </div>
                    <div class="changeChoose">
                        <p>
                            置换份额
                        </p>
                        <div>
                            <p class="moneyDischare">
                                差价不得高于3000 CNY
                            </p>
                            <p class="chooseNum">
                                <span>
                                    －
                                </span>
                                <input type="text" name="" value="2">
                                <span>
                                    ＋
                                </span>
                            </p>
                        </div>
                    </div>
                </div>
            </li> -->
        </ul>
    </div>
    <div class="hidebox hightBtcchange" style="display: none;">
        <ul class="hightBtcBox" style="padding-bottom: 6rem;">
            <!-- <li>
                <div>
                    <div class="lowerName">
                        <p>
                            <label for="chooseInput">
                                <input type="checkbox" name="hightMachine" id="chooseInput">
                                <span class="machineText">
                                    IPFS云算力(1T)
                                </span>
                            </label>
                        </p>
                        <p>

                        </p>
                    </div>
                    <p class="machineIconnew">
                        <span
                            style="width: 1rem;height: 0.34rem;background: #F3BB4A;border-radius: 2px;color: #ffffff;">
                            收益保障
                        </span>
                        <img src="../../image/iconyishouqinax.png" alt="已售罄" class="showEndNumnew">
                    </p>
                    <ul class="machineDetailnew">
                        <li>
                            <p>
                                <span>
                                    单份BTC算力:
                                </span>
                                <span class="payMonenyNum">
                                    --T
                                </span>
                            </p>
                            <p>
                                <span>
                                    单份BHP参配算力:
                                </span>
                                <span>
                                    --T
                                </span>
                            </p>
                        </li>
                        <li>
                            <p>
                                <span>
                                    预估收益率:
                                </span>
                                <span>
                                    约3%~99%
                                </span>
                            </p>
                            <p>
                                <span>
                                    日挖矿收益:
                                </span>
                                <span style="color: #F67311;">
                                    约8.63CNY/份
                                </span>
                            </p>
                        </li>
                        <li>
                            <p>
                                <span>
                                    单份金额:
                                </span>
                                <span style="color: #F67311;">
                                    1500 CNY / 425 USDT
                                </span>
                            </p>
                            <p style="width: auto;">
                            </p>
                        </li>
                    </ul>
                    <div class="showsuanlibao">
                        <p class="inputBox" style="margin-top: 0.14rem;">
                            <input type="checkbox" class="inputChecked" value="checksuanlibao" name="chooseOutcoin"
                                id="checksuanlibao">
                            <label for="checksuanlibao">
                                加配算力宝，收益享保障
                            </label>
                            <img src="../../image/iconshiyixasd.png" style="width: 0.3rem;">
                        </p>
                        <p class="inputBox" style="margin-top: 0.14rem;">
                            <input type="checkbox" class="inputChecked" value="baozhangrate" name="chooseOutcoin"
                                id="checkbaozhangrate">
                            <label for="checkbaozhangrate">
                                达到保障率，委托自动卖币
                            </label>
                            <img src="../../image/iconshiyixasd.png" style="width: 0.3rem;">
                        </p>
                    </div>
                    <div class="scriptureMachinenew">
                        <div>
                            <p>
                                剩余算力: <span>xxT</span>
                            </p>
                            <p>
                                开挖时间: <span>2020 6-19 00:00:00</span>
                            </p>
                        </div>
                    </div>
                    <div class="changeChoosenew">
                        <p>
                            置换份额
                        </p>
                        <div>
                            <p class="moneyDischare">
                                差价不得高于3000 CNY
                            </p>
                            <p class="chooseNumnew">
                                <span>
                                    －
                                </span>
                                <input type="text" name="lowermachine" value="2">
                                <span>
                                    ＋
                                </span>
                            </p>
                        </div>
                    </div>
                </div>
            </li> -->
        </ul>
    </div>
    <div class="fixedButtom hidebox ipfsChange">
        <ul class="ipfsChangeText" style="display: none;">
            <li>
                <p>
                    到手总存力
                </p>
                <p class="buyIpfsNum">
                    --
                </p>
            </li>
            <li>
                <p>
                    置换后到期时间
                </p>
                <p class="warkDays">
                    --
                </p>
            </li>
            <li>
                <p>
                    置换后合约金额
                </p>
                <p class="buyIpfsmoney">
                    --
                </p>
            </li>
            <li>
                <p>
                    差价
                </p>
                <p class="disPaymoney">
                    --
                </p>
            </li>
        </ul>
        <div class="submitMessage">
            <p class="chooseMessage">
                <span>
                    置换信息
                </span>
                <img src="../../image/up.png" class="ratoteImg rotatedeg">
            </p>
            <p class="putongText" data-checked="false">
                <img src="../../image/iconbblsdlx.png" id="endBtcArgee" style="width: 0.36rem;margin-right: 0.1rem;">
                我已阅读
                <span class="openAreeText" style="margin-left: 0.1rem;">
                </span>
            </p>
            <p class="buyIpfsArgeeBox" data-checked="false" style="display: none;">
                <img src="../../image/iconbblsdlx.png" id="buyIpfsArgee" style="width: 0.36rem;margin-right: 0.1rem;">
                我已阅读
                <span class="buyIpfsArgee" style="margin-left: 0.1rem;">
                    --
                </span>
            </p>
            <button class="submitButton notClick">
                确认
            </button>
        </div>
    </div>
    <div class="fixedButtomnew hidebox hightBtcchange" style="display: none;">
        <ul class="ipfsChangeTextnew" style="display: none;">
            <li>
                <p>
                    到手BTC总算力
                </p>
                <p class="totalBtcPower">
                    --
                </p>
            </li>
            <li>
                <p>
                    到手BHP参配算力
                </p>
                <p class="totalBhpower">
                    --
                </p>
            </li>
            <li>
                <p>
                    置换后到期时间
                </p>
                <p class="arrivData">
                    --
                </p>
            </li>
            <li>
                <p>
                    置换后合约金额
                </p>
                <p class="changeAfterNum">
                    --
                </p>
            </li>
            <li>
                <p>
                    差价
                </p>
                <p class="diffNummoney">
                    --
                </p>
            </li>
        </ul>
        <div class="submitMessagenew">
            <p class="chooseMessagenew">
                <span>
                    置换信息
                </span>
                <img src="../../image/up.png" class="ratoteImg rotatedeg">
            </p>
            <p class="putongTextnew" data-checked="false">
                <img src="../../image/iconbblsdlx.png" id="endBtcArgeenew" style="width: 0.36rem;margin-right: 0.1rem;">
                我已阅读
                <span class="openAreeTextnew" style="margin-left: 0.1rem;">
                </span>
            </p>
            <p class="hightMachineAgred" data-checked="false">
                <img src="../../image/iconbblsdlx.png" id="hightMachineArgee"
                    style="width: 0.36rem;margin-right: 0.1rem;">
                我已阅读
                <span class="hightMachineArgee" style="margin-left: 0.1rem;">
                    --
                </span>
            </p>
            <p class="suanlibaoArgee" data-checked="false">
                <img src="../../image/iconbblsdlx.png" id="suanlibaoArgeeText"
                    style="width: 0.36rem;margin-right: 0.1rem;">
                我已阅读
                <span class="suanlibaoArgeeText" style="margin-left: 0.1rem;">
                    --
                </span>
            </p>
            <button class="submitButtonNew notClick">
                确认
            </button>
        </div>
    </div>
</body>
<script src="../../script/autosize.js"></script>
<script src="../../script/fastclick.js"></script>
<script src="../../script/jquery_three_two_one.js"></script>
<script src="../../script/dotmin.js"></script>
<script src="../../script/app.js"></script>
<script>
    apiready = function () {
        var app = new APP();
        var account = app.getAccount();
        //当前页  总页数  支付币种  选择兑换IPfs矿机的ID  已选择订单的总额
        var curpage = 1, totalPage = 0, currency = "CNY", chooseId = "", changBtcMoney = 0, ipfsCnychangMoney = 0, ipfsUsdtchangeMoney = 0, chooseipfsNum = 0;
        var chooseBtcArr = [];//选择兑换份数
        var argmentId = "";//协议数据ID
        var putongArgee = {};//普通矿机终止协议
        var unitCnynew = 0;//IPFS单价CNY
        var unitUsdtnew = 0;//IPFS单价USDT
        var endBtcArgee = false, buyIpfsArgee = false;//false表示协议未选中
        var btcLowerObj = {
            calcArr: [],//用于计算超额的数组
            subArr: [],//用于提交的参数的数组
            readBtcArgee: false,//btc协议
            readTaobaoArgee: false,//套保协议
            readXiaoshouArgee: false,//btc高波销售协议
        }
        app.setStorage("changeMachineStore", {
            chooseArrItem: [],
            paycurry: "CNY"
        });
        //清除IPFS选择 相关数据
        function clearNum() {
            currency = "CNY", chooseId = "", changBtcMoney = 0, ipfsCnychangMoney = 0, ipfsUsdtchangeMoney = 0, chooseipfsNum = 0;
            chooseBtcArr = [];//选择兑换份数
            argmentId = "";//协议数据ID
            unitCnynew = 0;
            unitUsdtnew = 0;
            $(".buyIpfsNum,.warkDays,.buyIpfsmoney,.disPaymoney").text("--");
        }
        function clearIpfsNum() {
            ipfsCnychangMoney = 0, ipfsUsdtchangeMoney = 0, chooseipfsNum = 0;
            unitCnynew = 0;
            unitUsdtnew = 0;
            $(".buyIpfsNum,.warkDays,.buyIpfsmoney,.disPaymoney").text("--");
        }
        //清除高波BTC 相关数据
        function clearNumbtc() {
            btcLowerObj.calcArr.length = 0;
            btcLowerObj.subArr.length = 0;
            $(".totalBtcPower,.totalBhpower,.changeAfterNum,.arrivData,.diffNummoney").text("--");
        }
        function operIpfs(arrText) {
            var argenmentText = {
                thisId: "",
                thisTitle: ""
            };
            for (var i = 0; i < arrText.length; i++) {
                var element = arrText[i];
                if (element.lang == "zh-cn") {
                    argenmentText.thisId = arrText[i].article_id;
                    argenmentText.thisTitle = arrText[i].article_title;
                }
            }
            return argenmentText
        }

        function submitChoose(statusText, failText) {
            var goCerfition = {
                name: "changestatus",
                subpage: "rent/changestatus",
                title: "算力置换",
                param: {
                    pageName: "changestatus",
                    statusText: statusText,
                    failMessage: failText
                }
            };
            app.setNavBarAttr(goCerfition);
        }
        //可用置换IPFS矿机列表
        function couponList(account, page, currency, isdown) {
            app.ajaxPro({
                url: "ipfs/ipfs-replace-lists",
                values: {
                    token: account.token,
                    page: page,
                    currency: currency
                },
                openFlower: true
            }, function (ret) {
                if (ret.code == 200) {
                    var dataList = ret.data.lists;
                    putongArgee = ret.data.terminateContract;
                    if (ret.data.ReplacementQuota >= 0) {
                        $(".isShowBox").show();
                    }
                    changeArgmentName();
                    totalPage = ret.data.totalPage;
                    dataList.map(function (item) {
                        item.income_ratio = app.accMul(item.income_ratio, 100, 111);
                    })
                    var temp = doT.template($("#couponListLi").text());
                    if (isdown) {
                        $(".couponListBox").html(temp(dataList));
                    } else {
                        $(".couponListBox").append(temp(dataList));
                    }
                    if (page == 1 && dataList.length == 0) {
                        $("#listState").show();
                    } else {
                        $("#listState").hide();
                    }
                } else {
                    app.toast(ret.message)
                }
            })
        }
        couponList(account, curpage, currency, true);
        function getUnitPrice(arr, paycurry) {
            var goodsDeposit = 0;
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].pay_currency == paycurry) {
                    goodsDeposit = arr[i].goods_deposit
                }
            }
            return goodsDeposit
        }
        function getBtMachine(account, page, currency, isdown) {
            app.ajaxPro({
                url: "machine/replace-lists",
                values: {
                    token: account.token,
                    return_type: ""//不传全部，2不可回购 ，1可回购
                },
                openFlower: true
            }, function (ret) {
                if (ret.code == 200) {
                    var dataList = ret.data.list;
                    totalPage = 1;
                    dataList.map(function (item) {
                        item.isOpenSuanli = item.insurance_id ? true : false;
                        item.machine = {
                            cnyUnit: getUnitPrice(item.good_deposit, "CNY"),//矿机单价 CNY
                            chooseTotalCny: getUnitPrice(item.good_deposit, "CNY"),//选择的矿机总价
                            usdtUnit: getUnitPrice(item.good_deposit, "USDT"),//矿机单价 USDT
                            chooseTotalUsdt: getUnitPrice(item.good_deposit, "USDT"),//矿机总价 USDT
                            suanlibaoCny: app.sliceNum(item.insurance.cny_deposit, 2),//算力包单价 CNY
                            totalsuanliCny: app.sliceNum(item.insurance.cny_deposit, 2),//算力宝总金e
                            suanlibaoUsdt: app.sliceNum(item.insurance.usdt_deposit, 4),//算力包单价 USDT
                            totalsuanliUsdt: app.sliceNum(item.insurance.usdt_deposit, 4),//算力宝总金e
                            chooseNum: 1,//选择的份数
                            basepower: item.base_power,//btc算力
                            totalBasepower: app.accMul(1, item.base_power, 1551),//btc总算力
                            bhpBasepower: item.bhp_power,
                            totalBhppower: app.accMul(1, item.bhp_power, 1552),//BHP总算力
                            openSuanli: false,//是否打开算力宝  默认关闭
                            openAutoSell: false, //是否打开自动卖币 默认关闭 
                            stockNum: item.num_left,//库存数量
                            orderId: item.machine_id//订单ID
                        }
                        item.endDatanew = item.constract_end_date;//endstate
                        item.num_leftTotalPower = app.accMul(item.base_power, item.num_left, 1553);
                        item.contractText = JSON.stringify({
                            contractText: item.insurance_contract,//算力套保协议
                            contractHight: item.contract//高波销售协议
                        });
                        var predict_income_level = item.predict_income_level;
                        var minNum = predict_income_level[0].income_rate;//数组最小值
                        var maxNum = predict_income_level[0].income_rate;//数组最大值
                        for (var i in predict_income_level) {
                            var itemnew = predict_income_level[i];
                            if (itemnew.income_rate < minNum) {
                                minNum = itemnew.income_rate;
                            }
                            if (itemnew.income_rate > maxNum) {
                                maxNum = itemnew.income_rate;
                            }
                        }
                        maxNumRateNum = app.sliceNum(app.accMul(maxNum, 100, 1576), 2);//净收益率最大值
                        minNumRateNum = app.sliceNum(app.accMul(minNum, 100, 1577), 2);//最小值
                        item.income_ratePre = minNumRateNum + "% ~ " + maxNumRateNum;
                        item.machine = JSON.stringify(item.machine);
                        item.unitCnynew = app.sliceNum(getUnitPrice(item.good_deposit, "CNY"), 2);
                        item.unitUsdtnew = app.sliceNum(getUnitPrice(item.good_deposit, "USDT"), 4);
                    })
                    console.log("---------------" + JSON.stringify(dataList));
                    var temp = doT.template($("#btclowerbag").text());
                    if (isdown) {
                        $(".hightBtcBox").html(temp(dataList));
                    } else {
                        $(".hightBtcBox").append(temp(dataList));
                    }
                    if (page == 1 && dataList.length == 0) {
                        $("#listState").show();
                    } else {
                        $("#listState").hide();
                    }
                } else {
                    app.toast(ret.message)
                }
            })
        }
        $(".chooseConatrant p").click(function () {
            $(this).addClass("checkP").siblings().removeClass("checkP");
            $(".hidebox").hide();
            $("." + $(this).data("name")).show();
            if ($(this).data("name") == "ipfsChange") {
                clearNumbtc();
                couponList(account, curpage, currency, true);
            } else {
                clearIpfsNum();
                getBtMachine(account, curpage, currency, true);
            }
        })
        $(".goChooseBtc").click(function () {
            var cointypecontract = {
                name: "choosepower",
                subpage: "rent/choosepower",
                title: "选择合约包",
                rightTitle: "置换规则",
                param: {
                    pageName: "choosepower",
                    allowEdit: true,
                    rightParam: {
                        name: "choosepowerruler",
                        title: "置换规则"
                    }
                }
            }
            app.setNavBarAttr(cointypecontract);
        })
        //下拉刷新
        app.downRefresh(function () {
            $(".couponListBox").empty();
            curPage = 1;
            totalPage = 0;
            couponList(account, curpage, true);
        });
        app.headerMap(function (ret) {
            //临时测试
            // submitChoose();
            //打开置换记录
            var goCerfitionnew = {
                name: "replace_record",
                subpage: "rent/replace_record",
                title: "置换记录",
                param: {
                    pageName: "replace_record"
                }
            };
            app.setNavBarAttr(goCerfitionnew);
        });
        var className = "";//显示超过3000差价
        function calulaterMachine(event, rentNum) {
            unitCnynew = event.attr("data-cnyMoney");
            unitUsdtnew = event.attr("data-usdtMony");
            event.attr("data-chooseTotalCny", app.accMul(unitCnynew, rentNum));
            event.attr("data-chooseTotalUsdt", app.accMul(unitUsdtnew, rentNum));
            // console.log("rentNum" + rentNum + "****" + app.accMul(unitCnynew, rentNum) + "////" + app.accMul(unitUsdtnew, rentNum));
            event.attr("data-chooseNum", rentNum);
            chooseId = event.attr("data-orderId");
            ipfsCnychangMoney = event.attr("data-chooseTotalCny");
            ipfsUsdtchangeMoney = event.attr("data-chooseTotalUsdt");
            className = event.attr("data-showClass");
            chooseipfsNum = event.attr("data-chooseNum");
            argmentId = event.attr("data-contractId");
            // console.log("buyIpfsArgee" + operIpfs(argeeObj[currency]).thisTitle)
            if (argmentId) {
                var argeeObj = app.parse(argmentId);
                $(".buyIpfsArgeeBox").show().find(".buyIpfsArgee").text(operIpfs(argeeObj[currency]).thisTitle);
            } else {
                $(".buyIpfsArgeeBox").hide().find(".buyIpfsArgee").text("");
            }
            // console.log("ipfsCnychangMoney" + ipfsCnychangMoney + "ipfsUsdtchangeMoney" + ipfsUsdtchangeMoney);
            var disPriceCny = app.numSub(changBtcMoney, ipfsCnychangMoney);
            var disPeiceUsdt = app.numSub(changBtcMoney, ipfsUsdtchangeMoney);
            // console.log("className**" + currency + "disPriceCny///" + disPriceCny + "disPeiceUsdt" + disPeiceUsdt);
            if (currency == "CNY" && disPriceCny > 3000) {
                $("." + className).show().text("差价不得高于3000 CNY");
            } else if (currency == "CNY" && disPriceCny < 3000) {
                $("." + className).hide();
            } else if (currency == "USDT" && disPeiceUsdt > 425) {
                $("." + className).show().text("差价不得高于425 USDT");
            } else if (currency == "USDT" && disPeiceUsdt < 425) {
                $("." + className).hide();
            }
            $(".buyIpfsNum").text(app.accMul(chooseipfsNum, event.attr("data-totalpower")) + "TB");
            var warkDays = event.attr("data-warkday");
            $(".warkDays").text("开挖日+" + warkDays + "天");
            $(".buyIpfsmoney").text(ipfsCnychangMoney + "CNY");
            if (currency == "USDT") {
                $(".buyIpfsmoney").text(ipfsUsdtchangeMoney + "USDT");
            }
            var getCnyNum = app.numSub(changBtcMoney, ipfsCnychangMoney);
            var getUsdtNum = app.numSub(changBtcMoney, ipfsUsdtchangeMoney);
            if (currency == "CNY") {
                if (getCnyNum > 0) {
                    $(".disPaymoney").text("退回到余额:" + getCnyNum + "CNY");
                } else {
                    $(".disPaymoney").text("需补:" + app.accMul(getCnyNum, -1) + "CNY");
                }
            } else {
                if (getUsdtNum > 0) {
                    $(".disPaymoney").text("退回到余额:" + getUsdtNum + "USDT");
                } else {
                    $(".disPaymoney").text("需补:" + app.accMul(getUsdtNum, -1) + "USDT");
                }
            }
            if (chooseId) {
                $(".ipfsChangeText").show();
            }
        }
        $(".couponListBox").on("click", ".chooseNum span", function () {
            var typeClick = $(this).attr("data-type");
            var thisValue = $(this).parent().find("input").val();
            var maxchooseNum = $(this).attr("data-maxNum");
            var inputName = $(this).attr("data-classIdName");
            if (typeClick == "disButton") {
                if (thisValue > 0) {
                    thisValue--;
                }
                $(this).parent().find("input").val(thisValue);
            } else {
                var thisValue = $(this).parent().find("input").val();
                if (Number(thisValue) < Number(maxchooseNum)) {
                    thisValue++;
                }
            }
            $(this).parent().find("input").val(thisValue);
            // console.log("chooseId" + thisValue);
            var eventObj = $("#" + inputName);
            calulaterMachine(eventObj, thisValue);
        });
        var inputStartTime = 0; //开始输入第一个数字的时间
        $(".couponListBox").on("input porpertychange", ".chooseNum input", function (event) {
            var maxchooseNum = $(this).attr("data-maxNum");
            var inputName = $(this).attr("data-classIdName");
            inputStartTime = event.timeStamp;
            var thisEvent = $(this);
            setTimeout(function () {
                if (inputStartTime - event.timeStamp == 0) {
                    var thisVal = parseInt(thisEvent.val());
                    if (thisVal <= 0 || !thisVal) {
                        thisVal = 1;
                    }
                    if (Number(thisVal) > Number(maxchooseNum)) {
                        thisVal = maxchooseNum;
                    }
                    thisEvent.val(thisVal);
                    var eventObj = $("#" + inputName);
                    calulaterMachine(eventObj, thisVal);
                }
            }, 2000)
        });
        $(".couponListBox").on("click", "li .knowMore", function (e) {
            e.stopPropagation();
            var dataText = $(this).attr("data-text");
            if (dataText) {
                var param = {
                    dtype: "dialog82",
                    data: {
                        contant: dataText,
                    }
                };
                app.dialog(param);
            }
        })
        $(".couponListBox").on("click", "li .checkInput", function () {
            var thisvale = $(this).attr("data-chooseNum");
            var eventThis = $(this);
            calulaterMachine(eventThis, thisvale);
        });
        //请求IPFS协议
        function getAregment(article_id) {
            app.ajaxPro({
                url: "ipfs/get-contract-detail",
                values: {
                    token: account.token,
                    article_id: article_id.thisId
                },
                openFlower: true
            }, function (ret) {
                if (ret.code == 200) {
                    var param = {
                        dtype: "dialog80",
                        stopPropagation: true,
                        data: {
                            titel: article_id.thisTitle,
                            contant: ret.data.contractContent,
                            dataEvent: "buyIpfsArgee"
                        }
                    };
                    app.dialog(param);
                } else {
                    app.toast(ret.message);
                }
            })
        }
        function submitMachine(params) {
            // var value = {
            //     token: account.token,
            //     payment_code: currency,
            //     num: chooseipfsNum,
            //     product_id: chooseId,
            //     rrm_order: chooseBtcArr,
            //     product_price: currency == "CNY" ? unitCnynew : unitUsdtnew
            // }
            // console.log("-------------" + JSON.stringify(value));
            // return
            app.ajaxPro({
                url: "ipfs/rent",
                values: {
                    token: account.token,
                    payment_code: currency,
                    num: chooseipfsNum,
                    product_id: chooseId,
                    rrm_order: chooseBtcArr,
                    product_price: currency == "CNY" ? unitCnynew : unitUsdtnew
                },
                openFlower: true
            }, function (ret) {
                var statusText = "";
                var failtext = "";
                if (ret.code == 200) {
                    statusText = "succeful"
                } else {
                    statusText = "fail";
                    failtext = ret.message;
                }
                submitChoose(statusText, failtext);
            })
        }
        $(".submitButton").click(function () {
            if ($(".buyIpfsArgeeBox").attr("data-checked") == "false" || $(".putongText").attr("data-checked") == "false") {
                app.toast("请先阅读并同意协议");
                return
            }
            if (changBtcMoney <= 0) {
                app.toast("请选择置换的经典BTC合约包");
                return
            }
            if (!chooseId) {
                app.toast("请选择将要置换的矿机");
                return
            }
            var disPriceCnynew = app.numSub(changBtcMoney, ipfsCnychangMoney);
            var disPeiceUsdtnew = app.numSub(changBtcMoney, ipfsUsdtchangeMoney);
            if ((currency == "CNY" && disPriceCnynew > 3000) || (currency == "USDT" && disPeiceUsdtnew > 425)) {
                if (currency == "CNY") {
                    app.toast("退回到余额差价不得高于3000 CNY");
                } else {
                    app.toast("退回到余额差价不得高于425 USDT");
                }
                return
            }
            submitMachine();
        })
        $(".couponListBox").on('change', "input[name='machineList']", function () {
            chooseId = $(this).attr("data-orderId");
            $(".changeChoose").hide();
            if ($(this).prop("checked")) {
                var className = $(this).attr("data-className");
                $("." + className).show();
            }
        })
        //改变普通协议名称
        function changeArgmentName(params) {
            var putongArgeeObkj = putongArgee;
            $(".openAreeText,.openAreeTextnew").text(putongArgeeObkj[currency].name);
        }
        //打开协议弹窗
        function putongTextArg(params) {
            var putongArgeeObkj = putongArgee;
            var param = {
                dtype: "dialog80",
                stopPropagation: true,
                data: {
                    titel: putongArgeeObkj[currency].name,
                    contant: putongArgeeObkj[currency].content,
                    dataEvent: "endBtcArgee"
                }
            };
            app.dialog(param);
        }

        $(".chooseMessage").click(function () {
            $(".ipfsChangeText").slideToggle(100);
            if ($(this).find("img").hasClass("rotate")) {
                $(this).find("img").removeClass("rotate").addClass("rotatedeg");
            } else {
                $(this).find("img").removeClass("rotatedeg").addClass("rotate");
            }
        })
        //IPFS矿机
        $(".buyIpfsArgeeBox").click(function () {
            var thisChecked = $(this).attr("data-checked");
            if (thisChecked == "false") {
                var argeeObj = app.parse(argmentId);
                getAregment(operIpfs(argeeObj[currency]));
            } else {
                $("#buyIpfsArgee").attr("src", "../../image/iconbblsdlx.png");
                $(".buyIpfsArgeeBox").attr("data-checked", "false");
            }
        });
        //普通协议点击
        $(".putongText").click(function () {
            var thisChecked = $(this).attr("data-checked");
            if (thisChecked == "false") {
                putongTextArg();
            } else {
                $("#endBtcArgee").attr("src", "../../image/iconbblsdlx.png");
                $(".putongText").attr("data-checked", "false");
            }
        })
        //------------------------------------置换高波BTC-----------------------------------------
        //查找数组某一项并删除
        function operaArr(calcArr, orderID) {
            calcArr.filter(function (item, index, arr) {
                if (item.orderId == orderID) {
                    calcArr.splice(index, 1);
                }
            })
        }
        //计算选择的矿机总价
        function addchooseNum(currency, calcArr) {
            var totalNum = 0;
            for (var j = 0; j < calcArr.length; j++) {
                if (currency == "CNY") {
                    totalNum = app.accAdd(totalNum, calcArr[j].chooseTotalCny);
                } else {
                    totalNum = app.accAdd(totalNum, calcArr[j].chooseTotalUsdt);
                }
            }
            // console.log("-----------选择机器的总价" + totalNum);
            return totalNum
        }
        //矿机的选择
        $(".hightBtcBox").on("change", "input[name='hightMachine']", function () {
            btcLowerObj.calcArr.length = 0;
            // console.log("----------" + JSON.stringify(JSON.parse($(this).attr("data-macine"))));
            var isShowClass = $(this).attr("data-isshow");
            var machineData = JSON.parse($(this).attr("data-macine"));
            if (changBtcMoney <= 0) {
                $(this).prop("checked", false);
                return
            }
            if ($(this).is(":checked")) {
                btcLowerObj.calcArr.push(machineData);
                // console.log("----------------" + JSON.stringify(textContant));
                if ($(this).attr("data-isopen")) {
                    var textContant = JSON.parse($(this).attr("data-cantractText"));
                    $(".hightMachineArgee").text(textContant.contractHight[0].name);
                    $("." + isShowClass).show();
                    $(".suanlibaoArgeeText").text(textContant.contractText.name);
                }
                // console.log("添加数组" + JSON.stringify(btcLowerObj.calcArr));
            }
            // else {
            //     machineData.chooseNum = 1;
            //     machineData.chooseTotalCny = machineData.cnyUnit;
            //     machineData.chooseTotalUsdt = machineData.usdtUnit;
            //     machineData.totalsuanliCny = machineData.suanlibaoCny;
            //     machineData.totalsuanliUsdt = machineData.suanlibaoUsdt;
            //     machineData.openSuanli = false;
            //     machineData.openAutoSell = false;
            //     $("." + isShowClass).hide().prop("checked", false);
            //     $(this).attr("data-macine", JSON.stringify(machineData));
            //     operaArr(btcLowerObj.calcArr, machineData.orderId);
            //     // console.log("删除数组" + JSON.stringify(btcLowerObj.calcArr));
            // }
            // console.log("查看数组数组" + JSON.stringify(btcLowerObj.calcArr));
            // var calcNum = addchooseNum(currency, btcLowerObj.calcArr);
            // if (Math.abs(changBtcMoney - calcNum) > 3000 && currency == "CNY" && btcLowerObj.calcArr.length > 1) {
            //     // $(this).prop("checked", false);
            //     // $("." + isShowClass).hide().prop("checked", false);
            //     app.toast("差价不能查过3000 CNY");
            // }
            // if (Math.abs(calcNum - changBtcMoney) > 425 && currency == "USDT" && btcLowerObj.calcArr.length > 1) {
            //     // $(this).prop("checked", false);
            //     // $("." + isShowClass).hide().prop("checked", false);
            //     app.toast("差价不能查过425 USDT");
            // }
            var inputtotal = addchooseNum(currency, btcLowerObj.calcArr);
            if ((Number(changBtcMoney) - Number(inputtotal) > 3000 && currency == "CNY") || (Number(changBtcMoney) - Number(inputtotal) > 425 && currency == "USDT")) {
                if (currency == "CNY") {
                    $("." + $(this).attr("data-showTips")).show();
                } else {
                    $("." + $(this).attr("data-showTips")).show().text("差价不得高于425 USDT");
                }
            } else {
                $(".moneyDischare").hide();
                $("." + $(this).attr("data-showTips")).hide();
            }
            calcTextNum();
            $(".ipfsChangeTextnew").show();
        })
        // 防抖函数
        function debounce(fn, delay) {
            var timer;
            return function () {
                var context = this;
                var args = arguments;
                clearTimeout(timer);
                timer = setTimeout(function () {
                    fn.apply(context, args)
                }, delay)
            }
        };
        //改变数组
        function changeArrItem(currency, calcArr, orderId, value) {
            for (var k = 0; k < calcArr.length; k++) {
                if (orderId == calcArr[k].orderId) {
                    calcArr[k].chooseNum = value;
                    calcArr[k].chooseTotalCny = app.accMul(calcArr[k].cnyUnit, value, 14);
                    calcArr[k].chooseTotalUsdt = app.accMul(calcArr[k].usdtUnit, value, 15);
                    calcArr[k].totalBasepower = app.accMul(calcArr[k].basepower, value, 16);
                    calcArr[k].totalBhppower = app.accMul(calcArr[k].bhpBasepower, value, 17);
                    calcArr[k].totalsuanliCny = app.accMul(calcArr[k].suanlibaoCny, value, 18);
                    calcArr[k].totalsuanliUsdt = app.accMul(calcArr[k].suanlibaoUsdt, value, 19);
                }
            }
        }
        //计算显示相关
        var isnotArgee = false;//是否超过额定的差价
        var machid = "", rentNumnew = 0, agrentId = "", suanlibaoText = {}, isAutomabi = false, ischeckSuanli = false, endDataTime = "";//矿机ID 租用份数 协议ID 是否自动卖币  是否套保
        function calcTextNum() {
            btcLowerObj.subArr.length = 0;
            var totalArrValue = {
                arrBasePower: 0,
                arrBhppower: 0,
                unitPrice: 0,
                unitPriceUsdt: 0
            }
            var dataThis = "";
            $("input:radio[name=hightMachine]").each(function () {
                if ($(this).is(':checked')) {
                    dataThis = $(this);
                    var nameOptin = JSON.parse($(this).attr("data-macine"));
                    machid = nameOptin.orderId;
                    rentNumnew = nameOptin.chooseNum;
                    agrentId = JSON.parse($(this).attr("data-cantractText")).contractHight[0].code;
                    suanlibaoText = JSON.parse($(this).attr("data-cantractText")).contractText;
                    isAutomabi = nameOptin.openAutoSell;
                    ischeckSuanli = nameOptin.openSuanli;
                    endDataTime = $(this).attr("data-endData");
                    totalArrValue = {
                        arrBasePower: nameOptin.totalBasepower,
                        arrBhppower: nameOptin.totalBhppower,
                        unitPrice: nameOptin.chooseTotalCny,
                        unitPriceUsdt: nameOptin.chooseTotalUsdt,
                        totalsuanliCny: nameOptin.totalsuanliCny,
                        totalsuanliUsdt: nameOptin.totalsuanliUsdt
                    }
                    btcLowerObj.subArr.push(totalArrValue);
                }
            });
            var totalbasetext = 0, totalBhpText = 0, cnyTotalText = 0, usdtTotalText = 0, totalSunalibao = 0, totalSunalibaoUsdt = 0;
            for (var m = 0; m < btcLowerObj.subArr.length; m++) {
                totalbasetext = app.accAdd(btcLowerObj.subArr[m].arrBasePower, totalbasetext); 0//总基础算力
                totalBhpText = app.accAdd(btcLowerObj.subArr[m].arrBhppower, totalBhpText);//总BHP算力
                cnyTotalText = app.accAdd(btcLowerObj.subArr[m].unitPrice, cnyTotalText);//总CNY价格
                usdtTotalText = app.accAdd(btcLowerObj.subArr[m].unitPriceUsdt, usdtTotalText);//总USDT
                totalSunalibao = app.accAdd(btcLowerObj.subArr[m].totalsuanliCny, totalSunalibao);//算力包总CNY
                totalSunalibaoUsdt = app.accAdd(btcLowerObj.subArr[m].totalsuanliUsdt, totalSunalibaoUsdt);//算力包USDT
            }
            // console.log("------------------填数据" + JSON.stringify(btcLowerObj.subArr));
            $(".totalBtcPower").text(totalbasetext + "T");
            $(".totalBhpower").text(totalBhpText + "T");
            if ((Math.abs(app.numSub(changBtcMoney, cnyTotalText)) < 3000 && currency == "CNY") || (Math.abs(app.numSub(changBtcMoney, usdtTotalText)) < 425 && currency == "USDT")) {
                $(".hightBtcBox .moneyDischare").hide();
            }
            $(".arrivData").text(endDataTime);
            if (currency == "USDT") {
                $(".changeAfterNum").text(usdtTotalText + "USDT");
                var diffMoney = app.numSub(changBtcMoney, usdtTotalText);
                $(".diffNummoney").text((diffMoney < 0 ? "需补:" : "退回到余额:") + Math.abs(diffMoney) + "USDT");
                if (dataThis.attr("data-openSunali") == "true") {
                    $(".changeAfterNum").text(app.accAdd(usdtTotalText, totalSunalibaoUsdt) + "USDT");
                    diffMoney = app.accMoreSub(changBtcMoney, usdtTotalText, totalSunalibaoUsdt);
                    $(".diffNummoney").text((diffMoney < 0 ? "需补:" : "退回到余额:") + Math.abs(diffMoney) + "USDT");
                }
                if (diffMoney > 425) {
                    isnotArgee = true;
                } else {
                    isnotArgee = false;
                }
                return
            }
            var diffMoneynew = app.numSub(changBtcMoney, cnyTotalText);
            $(".changeAfterNum").text(cnyTotalText + "CNY");
            $(".diffNummoney").text((diffMoneynew < 0 ? "需补:" : "退回到余额:") + Math.abs(diffMoneynew) + "CNY");
            if (dataThis.attr("data-openSunali") == "true") {
                $(".changeAfterNum").text(app.accAdd(cnyTotalText, totalSunalibao) + "CNY");
                diffMoneynew = app.accMoreSub(changBtcMoney, cnyTotalText, totalSunalibao);
                $(".diffNummoney").text((diffMoneynew < 0 ? "需补:" : "退回到余额:") + Math.abs(diffMoneynew) + "CNY");
            }
            if (diffMoneynew > 3000) {
                isnotArgee = true;
            } else {
                isnotArgee = false;
            }
        }
        //计算数据并保存
        function saveData(eventData, obj, num) {
            var objData = obj;
            objData.chooseNum = num;
            objData.chooseTotalCny = app.accMul(num, objData.cnyUnit, 2101);
            objData.chooseTotalUsdt = app.accMul(num, objData.usdtUnit, 2102);
            objData.totalBasepower = app.accMul(num, objData.basepower, 2103);
            objData.totalBhppower = app.accMul(num, objData.bhpBasepower, 2104);
            objData.totalsuanliCny = app.accMul(num, objData.suanlibaoCny, 2105);
            objData.totalsuanliUsdt = app.accMul(num, objData.suanlibaoUsdt, 2106);
            eventData.attr("data-macine", JSON.stringify(objData));
        }
        //封装计算最大值相关数据
        function calamaxNum(newArr, orderId, dataObj, currency) {
            //屏蔽上限为3000或者 425的限制
            // var oldArr = JON.parse(JSON.stringify(newArr));
            // operaArr(oldArr, orderId);
            // // console.log("----------删除后的数组" + JSON.stringify(oldArr));
            // var totalNum = addchooseNum(currency, oldArr);//删除当前项后 总额
            // var unitPrice = dataObj.cnyUnit;//操作当前矿机的单价 CNY
            // var limitMoney = app.accAdd(app.numSub(changBtcMoney, totalNum), 3000);//当前矿机能租用最多的钱 CNY 3000表示 加上差价后最大租用数量
            // // console.log("-------------------剩余的钱" + limitMoney);
            // if (currency == "USDT") {
            //     unitPrice = dataObj.usdtUnit;
            //     limitMoney = app.accAdd(app.numSub(changBtcMoney, totalNum), 425);
            // }
            // var maxRent = Math.floor(app.accDiv(limitMoney, unitPrice));
            // if (maxRent > dataObj.stockNum) {
            //     maxRent = dataObj.stockNum;
            // }
            // console.log("*************公共方法" + maxRent);
            return dataObj.stockNum;
        }
        //矿机的选择
        $(".hightBtcBox").on("change", "input[name='hightMachine']", function () {
            btcLowerObj.calcArr.length = 0;
            // console.log("----------" + JSON.stringify(JSON.parse($(this).attr("data-macine"))));
            var isShowClass = $(this).attr("data-isshow");
            var machineData = JSON.parse($(this).attr("data-macine"));
            if (changBtcMoney <= 0) {
                $(this).prop("checked", false);
                return
            }
            if ($(this).is(":checked")) {
                btcLowerObj.calcArr.push(machineData);
                // console.log("----------------" + JSON.stringify(textContant));
                if ($(this).attr("data-isopen")) {
                    var textContant = JSON.parse($(this).attr("data-cantractText"));
                    $(".hightMachineArgee").text(textContant.contractHight[0].name);
                    $("." + isShowClass).show();
                    $(".suanlibaoArgeeText").text(textContant.contractText.name);
                }
                // console.log("添加数组" + JSON.stringify(btcLowerObj.calcArr));
            } else {
                machineData.chooseNum = 1;
                machineData.chooseTotalCny = machineData.cnyUnit;
                machineData.chooseTotalUsdt = machineData.usdtUnit;
                machineData.totalsuanliCny = machineData.suanlibaoCny;
                machineData.totalsuanliUsdt = machineData.suanlibaoUsdt;
                machineData.openSuanli = false;
                machineData.openAutoSell = false;
                $("." + isShowClass).hide().prop("checked", false);
                $(this).attr("data-macine", JSON.stringify(machineData));
                operaArr(btcLowerObj.calcArr, machineData.orderId);
                // console.log("删除数组" + JSON.stringify(btcLowerObj.calcArr));
            }
            var inputtotal = addchooseNum(currency, btcLowerObj.calcArr);
            if ((Number(changBtcMoney) - Number(inputtotal) > 3000 && currency == "CNY") || (Number(changBtcMoney) - Number(inputtotal) > 425 && currency == "USDT")) {
                if (currency == "CNY") {
                    $("." + $(this).attr("data-showTips")).show();
                } else {
                    $("." + $(this).attr("data-showTips")).show().text("差价不得高于425 USDT");
                }
            } else {
                $(".moneyDischare").hide();
                $("." + $(this).attr("data-showTips")).hide();
            }
            calcTextNum();
            $(".ipfsChangeTextnew").show();
        })

        //输入租用份数
        $(".hightBtcBox").on("input porpertychange", ".chooseNumnew input[name='lowermachine']", debounce(function () {
            var classNamenew = $(this).attr("data-calssName");
            var dataMachine = JSON.parse($("." + classNamenew).attr("data-macine"));
            var diffNum = calamaxNum(btcLowerObj.calcArr, dataMachine.orderId, dataMachine, currency);
            var thisValue = $(this).val();
            var copyArr = JSON.parse(JSON.stringify(btcLowerObj.calcArr));//拷贝数组
            //当前输入框与最大值做比较
            if (Number(thisValue) > Number(diffNum)) {
                thisValue = diffNum;
                $(this).val(thisValue);
            }
            changeArrItem(currency, btcLowerObj.calcArr, dataMachine.orderId, thisValue);
            changeArrItem(currency, copyArr, dataMachine.orderId, thisValue);
            var inputtotal = addchooseNum(currency, copyArr);//代入输入框输入值 重新计算总价
            saveData($("." + classNamenew), dataMachine, thisValue);
            // console.log("============差值" + Number(inputtotal) + "===" + Number(changBtcMoney));
            if ((Number(changBtcMoney) - Number(inputtotal) > 3000 && currency == "CNY") || (Number(changBtcMoney) - Number(inputtotal) > 425 && currency == "USDT")) {
                if (currency == "CNY") {
                    $("." + $("." + classNamenew).attr("data-showTips")).show();
                } else {
                    $("." + $("." + classNamenew).attr("data-showTips")).show().text("差价不得高于425 USDT");
                }
            } else {
                $(".moneyDischare").hide();
                $("." + $("." + classNamenew).attr("data-showTips")).hide();
            }
            calcTextNum();
        }, 2000))
        //算力宝的选择
        $(".hightBtcBox").on("change", ".showsuanlibao input[name='chooseOutcoin']", function () {
            var isShowAuto = $(this).attr("data-inputName");
            var className = $(this).attr("data-calssName");
            var machineData = JSON.parse($("." + className).attr("data-macine"));
            if ($(this).is(":checked")) {
                $("." + isShowAuto).show();
                machineData.openSuanli = true;
                machineData.totalsuanliCny = app.accMul(machineData.suanlibaoCny, machineData.chooseNum);
                machineData.totalsuanliUsdt = app.accMul(machineData.suanlibaoUsdt, machineData.chooseNum);
                $("." + className).attr("data-openSunali", "true");
            } else {
                machineData.openSuanli = false;
                machineData.openAutoSell = false;
                machineData.totalsuanliCny = machineData.suanlibaoCny;
                machineData.totalsuanliUsdt = machineData.suanlibaoUsdt;
                $("#" + isShowAuto).prop("checked", false);
                $("." + isShowAuto).hide();
                $("." + className).attr("data-openAuto", "false");
                $("." + className).attr("data-openSunali", "false");
            }
            $("." + className).attr("data-macine", JSON.stringify(machineData));
            // console.log("---" + JSON.stringify($("." + className).attr("data-macine")))
            calcTextNum();
        })
        //自动卖币的选择
        $(".hightBtcBox").on("change", ".showsuanlibao input[name='chooseOutcoinnew']", function () {
            var className = $(this).attr("data-calssName");
            var dataMachine = JSON.parse($("." + className).attr("data-macine"));
            if ($(this).is(":checked")) {
                dataMachine.openAutoSell = true;
                $("." + className).attr("data-openAuto", "true");
            } else {
                dataMachine.openAutoSell = false;
                $("." + className).attr("data-openAuto", "false");
            }
            $("." + className).attr("data-macine", JSON.stringify(dataMachine));
            // console.log("---" + JSON.stringify($("." + className).attr("data-macine")))
        })
        //点击减号
        $(".hightBtcBox").on("click", ".chooseNumnew .disButtonnew", function () {
            var classNamenew = $(this).attr("data-calssName");
            var inputValue = $(this).parent().find("input").val();
            var dataMachine = JSON.parse($("." + classNamenew).attr("data-macine"));
            var copyArr = JSON.parse(JSON.stringify(btcLowerObj.calcArr));//拷贝数组
            if (inputValue > 1) {
                inputValue--
            }
            $(this).parent().find("input").val(inputValue);
            changeArrItem(currency, btcLowerObj.calcArr, dataMachine.orderId, inputValue);
            changeArrItem(currency, copyArr, dataMachine.orderId, inputValue);
            saveData($("." + classNamenew), dataMachine, inputValue);
            var inputtotal = addchooseNum(currency, copyArr);//代入输入框输入值 重新计算总价
            if ((Number(changBtcMoney) - Number(inputtotal) > 3000 && currency == "CNY") || (Number(changBtcMoney) - Number(inputtotal) > 425 && currency == "USDT")) {
                if (currency == "CNY") {
                    $("." + $("." + classNamenew).attr("data-showTips")).show();
                } else {
                    $("." + $("." + classNamenew).attr("data-showTips")).show().text("差价不得高于425 USDT");
                }
            } else {
                $(".moneyDischare").hide();
                $("." + $("." + classNamenew).attr("data-showTips")).hide();
            }
            calcTextNum();
        })
        //点击加号
        $(".hightBtcBox").on("click", ".chooseNumnew .addButtonnew", function () {
            var classNamenew = $(this).attr("data-calssName");
            var copyArr = JSON.parse(JSON.stringify(btcLowerObj.calcArr));//拷贝数组
            var inputValue = $(this).parent().find("input").val();
            var dataMachine = JSON.parse($("." + classNamenew).attr("data-macine"));
            var diffNum = calamaxNum(btcLowerObj.calcArr, dataMachine.orderId, dataMachine, currency);//最大租用值
            //当前输入框与最大值做比较
            if (Number(inputValue) < Number(diffNum)) {
                inputValue++;
            }
            $(this).parent().find("input").val(inputValue);
            changeArrItem(currency, btcLowerObj.calcArr, dataMachine.orderId, inputValue);
            changeArrItem(currency, copyArr, dataMachine.orderId, inputValue);
            saveData($("." + classNamenew), dataMachine, inputValue);
            var inputtotal = addchooseNum(currency, copyArr);//代入输入框输入值 重新计算总价
            if ((Number(changBtcMoney) - Number(inputtotal) > 3000 && currency == "CNY") || (Number(changBtcMoney) - Number(inputtotal) > 425 && currency == "USDT")) {
                if (currency == "CNY") {
                    $("." + $("." + classNamenew).attr("data-showTips")).show();
                } else {
                    $("." + $("." + classNamenew).attr("data-showTips")).show().text("差价不得高于425 USDT");
                }
            } else {
                $(".moneyDischare").hide();
                $("." + $("." + classNamenew).attr("data-showTips")).hide();
            }
            calcTextNum();
        })
        //弹框 
        $(".hightBtcBox").on("click", ".showsuanlibao .showDailogone", function () {
            var param = {
                dtype: "dialog70",
            };
            app.dialog(param);
        })
        $(".hightBtcBox").on("click", ".showsuanlibao .showDailogtwo", function () {
            var param = {
                dtype: "dialog47",
                data: {
                    text: "当收益达到保障率，算力宝销售方将把产币卖为USDT,<span style='color:#ED3434'>发放至BHPAY</span>",
                    underTexttips: "*实际成交价以市场价为准",
                    event: "openSellAuto"
                }
            };
            app.dialog(param);
        })
        //点击置换信息
        $(".chooseMessagenew").click(function () {
            $(".ipfsChangeTextnew").slideToggle(100);
            if ($(this).find("img").hasClass("rotate")) {
                $(this).find("img").removeClass("rotate").addClass("rotatedeg");
            } else {
                $(this).find("img").removeClass("rotatedeg").addClass("rotate");
            }
        })
        //高波矿机协议
        //打开协议弹窗
        function putongTextArgnew(params) {
            var putongArgeeObkj = putongArgee;
            var param = {
                dtype: "dialog80",
                stopPropagation: true,
                data: {
                    titel: putongArgeeObkj[currency].name,
                    contant: putongArgeeObkj[currency].content,
                    dataEvent: "endBtcArgeenew"
                }
            };
            app.dialog(param);
        }
        //普通协议点击
        $(".putongTextnew").click(function () {
            var thisChecked = $(this).attr("data-checked");
            if (thisChecked == "false") {
                putongTextArgnew();
            } else {
                $("#endBtcArgeenew").attr("src", "../../image/iconbblsdlx.png");
                $(".putongTextnew").attr("data-checked", "false");
            }
        })
        app.listen("endBtcArgeenew", function () {
            $("#endBtcArgeenew").attr("src", "../../image/iconaazasax.png");
            $(".putongTextnew").attr("data-checked", "true");
        });
        function getBodongText(account, arguntID, machineId, buyelecNum, currency) {
            app.ajaxPro({
                url: "machine/get-contact",
                values: {
                    token: account.token,
                    code: arguntID,
                    machine_id: machineId,
                    num: buyelecNum,
                    currency: currency == "CNY" ? "RRM_CASH" : "RRM_USDT",
                },
                openFlower: true,
            }, function (ret) {
                if (ret.code == 200) {
                    var param = {
                        dtype: "dialog80",
                        stopPropagation: true,
                        data: {
                            titel: ret.data.contact.name,
                            contant: ret.data.contact.content,
                            dataEvent: "hightMachineAgred"
                        }
                    };
                    app.dialog(param);
                } else {
                    app.toast(ret.message);
                }
            });
        }
        //高波动销售协议
        $(".hightMachineAgred").click(function () {
            if (!machid) return
            var thisChecked = $(this).attr("data-checked");
            if (thisChecked == "false") {
                // console.log("----------------" + agrentId);
                getBodongText(account, agrentId, machid, rentNumnew, currency);
            } else {
                $("#hightMachineArgee").attr("src", "../../image/iconbblsdlx.png");
                $(".hightMachineAgred").attr("data-checked", "false");
            }
        });
        app.listen("hightMachineAgred", function () {
            $("#hightMachineArgee").attr("src", "../../image/iconaazasax.png");
            $(".hightMachineAgred").attr("data-checked", "true");
        });
        function opensuanlibao(suanlibaoText) {
            var param = {
                dtype: "dialog80",
                stopPropagation: true,
                data: {
                    titel: suanlibaoText.name,
                    contant: suanlibaoText.content,
                    dataEvent: "suanlibaoArgee"
                }
            };
            app.dialog(param);
        }
        //算力宝协议
        $(".suanlibaoArgee").click(function () {
            if (!machid) return
            var thisChecked = $(this).attr("data-checked");
            if (thisChecked == "false") {
                var argeeObj = app.parse(argmentId);
                opensuanlibao(suanlibaoText);
            } else {
                $("#suanlibaoArgeeText").attr("src", "../../image/iconbblsdlx.png");
                $(".suanlibaoArgee").attr("data-checked", "false");
            }
        });
        app.listen("suanlibaoArgee", function () {
            $("#suanlibaoArgeeText").attr("src", "../../image/iconaazasax.png");
            $(".suanlibaoArgee").attr("data-checked", "true");
        });
        function changHightBtc() {
            var checkSuanli = 0, automabi = 0;
            if (ischeckSuanli == true) {
                checkSuanli = 1
            }
            if (isAutomabi == true) {
                automabi = 1
            }
            var statusTextnew = "", failtextnew = "";
            app.ajaxPro({
                url: "order/rent",
                values: {
                    token: account.token,
                    machine_id: machid,
                    num: rentNumnew,
                    pay_channel: currency == "CNY" ? "RRM_CASH" : "RRM_USDT",
                    blackBox: "",
                    yzm_token: "",
                    is_insurance: checkSuanli,
                    electricity: "",
                    is_pay_electric: 0,
                    recordIds: "",
                    is_auto_mb: automabi,
                    is_replace: 1,
                    rrm_order: chooseBtcArr
                },
                openFlower: true,
            }, function (ret) {
                if (ret.code == 200) {
                    statusTextnew = "succeful"
                } else {
                    statusTextnew = "fail";
                    failtextnew = ret.message;
                }
                submitChoose(statusTextnew, failtextnew);
            });
            // console.log("--------------isAutomabi///" + isAutomabi + "****ischeckSuanli----" + ischeckSuanli + JSON.stringify({
            //     token: account.token,
            //     machine_id: machid,
            //     num: rentNumnew,
            //     pay_channel: currency == "CNY" ? "RRM_CASH" : "RRM_USDT",
            //     blackBox: "",
            //     yzm_token: "",
            //     is_insurance: checkSuanli,
            //     electricity: "",
            //     is_pay_electric: 0,
            //     recordIds: "",
            //     is_auto_mb: automabi,
            //     is_replace: 1,
            //     rrm_order: chooseBtcArr
            // }))
            // return
        }
        $(".submitButtonNew").click(function () {
            if ($(".putongTextnew").attr("data-checked") == "false" || $(".hightMachineAgred").attr("data-checked") == "false" || $(".suanlibaoArgee").attr("data-checked") == "false") {
                app.toast("请先阅读协议");
                return
            }
            if (changBtcMoney <= 0) {
                app.toast("请选择置换的经典BTC合约包");
                return
            }
            if (isnotArgee == true) {
                app.toast("差价不能超过3000或者425USDT");
                return
            }
            calcTextNum();
            changHightBtc();
        })
        //======================================ipfs矿机======================
        app.listen("goSeeIpfs", function () {
            app.closeW("changeIpfs");
        });
        app.listen("endBtcArgee", function () {
            $("#endBtcArgee").attr("src", "../../image/iconaazasax.png");
            $(".putongText").attr("data-checked", "true");
        });
        app.listen("buyIpfsArgee", function () {
            $("#buyIpfsArgee").attr("src", "../../image/iconaazasax.png");
            $(".buyIpfsArgeeBox").attr("data-checked", "true");
        });
        //监听普通矿机选择
        app.listen("succefulChoose", function (ret) {
            couponList(account, curpage, currency, true);
            // console.log("ret" + JSON.stringify(ret));
            clearNum();
            changBtcMoney = ret.value.moneyNum;
            currency = ret.value.paycurry;
            $(".changBtcMoney").text(ret.value.moneyNum + ret.value.paycurry);
            changeArgmentName();
            $(".submitButton,.submitButtonNew").removeClass("notClick");
            for (var i = 0; i < ret.value.chooseArrItem.length; i++) {
                var element = ret.value.chooseArrItem[i];
                var valueObj = {
                    num: element.chooseNum,
                    order_num: element.orderId
                }
                chooseBtcArr.push(valueObj);
            }
        })
    }
</script>
<script type="text/html" id="couponListLi">
    {{~it:it:index}}
    <li>
        <div>
            <div class="machineName">
                <p>
                    <label for="chooseInput{{=index}}">
                        <input type="radio" class="checkInput" 
                        data-orderId={{=it.product_id}} 
                        name="machineList" 
                        id="chooseInput{{=index}}" 
                        data-className="changeChoose{{=index}}"
                        data-cnyMoney="{{=it.cny_price}}"
                        data-chooseTotalCny="{{=it.cny_price}}"
                        data-usdtMony="{{=it.usdt_price}}"
                        data-chooseTotalUsdt="{{=it.usdt_price}}"
                        data-chooseNum="1"
                        data-showClass="moneyDischare{{=index}}"
                        data-warkday={{=it.plan_days}}
                        data-contractId='{{=it.contract}}'
                        data-totalpower="{{=it.total_power}}"
                        >
                        <span class="machineText">
                            {{=it.zh_cn_name}}
                        </span>
                    </label>
                </p>
                <p class="knowMore" data-text='{{=it.zh_cn_description}}'>
                    了解更多
                </p>
            </div>
            <p class="machineIcon">
                <span>
                    头矿红利
                </span>
                <!-- <span class="showNoreturn" style="background-color: #FCF5E2;color:#F19224;font-size: 0.2rem;display: inline-block;height: 0.34rem;padding: 0 0.15rem;line-height: 0.34rem;margin-right: 0.1rem;border-radius: 0.04rem;">
                    不可回购
                </span> -->
                {{?it.stock<=0}}
                    <img src="../../image/iconyishouqinax.png" alt="已售罄" class="showEndNum">
                {{?}}    
            </p>
            <ul class="machineDetail">
                <li>
                    <p>
                        <span>
                            单份金额:
                        </span>
                        <span class="payMonenyNum">
                            {{=it.cny_price}}<span style="font-size: 0.18rem;">CNY/</span>{{=it.usdt_price}}<span style="font-size: 0.18rem;">USDT</span>
                        </span>
                    </p>
                    <p>
                        <span>
                            单份存力:
                        </span>
                        <span>
                            {{=it.total_power}}TB
                        </span>
                    </p>
                </li>
                <li>
                    <p>
                        <span>
                            合约周期:
                        </span>
                        <span>
                            {{=it.plan_days}}天
                        </span>
                    </p>
                    <p>
                        <span>
                            剩余份额:
                        </span>
                        <span>
                            {{=it.stock}}份
                        </span>
                    </p>
                </li>
                <li>
                    <p>
                        <span>
                            分币比例:
                        </span>
                        <span>
                            {{=it.income_ratio}}%
                        </span>
                    </p>
                    <p>
                    </p>
                </li>
                <li>
                    <p style="flex:1;">
                        <span>
                            开挖时间:
                        </span>
                        <span>
                            {{=it.mining_time}}
                        </span>
                    </p>
                    <p style="width:0.2rem;">
                    </p>
                </li>
            </ul>
            {{? Number(it.ext_btc_power)> 0}}
            <div class="scriptureMachine">
                <div>
                    <p>
                        赠送经典BTC:<span>{{=it.ext_btc_power}}T</span>
                    </p>
                    <p>
                        开挖时间:<span>{{=it.ext_btc_mining_time}}</span>
                    </p>
                </div>
            </div>
            {{?}}
            <div class="changeChoose changeChoose{{=index}}" style="display:none;">
                <p>
                    置换份额
                </p>
                <div>
                    <p class="moneyDischare moneyDischare{{=index}}" style="display:none;">
                        差价不得高于3000 CNY
                    </p>
                    <p class="chooseNum">
                        <span class="disButton" data-classIdName="chooseInput{{=index}}" data-type="disButton" data-maxNum={{=it.stock}} >
                            －
                        </span>
                        <input type="text" value="1"  data-classIdName="chooseInput{{=index}}"  data-maxNum={{=it.stock}}>
                        <span class="addButton" data-classIdName="chooseInput{{=index}}" data-type="addButton" data-maxNum={{=it.stock}}>
                            ＋
                        </span>
                    </p>
                </div>
            </div>
        </div>
    </li>
    {{~}}
</script>
<script type="text/html" id="btclowerbag">
    {{~it:it:index}}
    <li >
        <div>
            <div class="lowerName">
                <p>
                    <label for="chooseInput{{=index}}" >
                        <input type="radio" name="hightMachine" id="chooseInput{{=index}}" data-isopen={{=it.isOpenSuanli}} class="chooseMachine{{=index}}" data-macine={{=it.machine}} data-isshow="showclass{{=index}}" data-showTips="moneyDischarenew{{=index}}" data-cantractText='{{=it.contractText}}' data-openSunali="false" data-openAuto="false" data-endData={{=it.endDatanew}}>
                        <span class="machineText">
                            {{=it.name}}
                        </span>
                    </label>
                </p>
                <p>

                </p>
            </div>
            <p class="machineIconnew">
                <span style="width: 1rem;height: 0.34rem;background: #F3BB4A;border-radius: 2px;color: #ffffff;">
                    收益保障
                </span>
                <span style="margin-left:0.1rem;background:#FCF8EB;color:#B17F1A;">
                    合约期{{=it.regular_date_num}}天
                </span>
                {{?it.num_leftTotalPower == 0}}
                    <img src="../../image/iconyishouqinax.png" alt="已售罄" class="showEndNumnew">
                {{?}}
            </p>
            <ul class="machineDetailnew">
                <li>
                    <p>
                        <span>
                            单份BTC算力:
                        </span>
                        <span class="payMonenyNum">
                            {{=it.base_power}}T
                        </span>
                    </p>
                    <p>
                        <span>
                            单份BHP参配算力:
                        </span>
                        <span>
                            {{=it.bhp_power}}T
                        </span>
                    </p>
                </li>
                <li>
                    <p>
                        <span>
                            预估收益率:
                        </span>
                        <span>
                            约{{=it.income_ratePre}}%
                        </span>
                    </p>
                    <p>
                        <span>
                            日挖矿收益:
                        </span>
                        <span style="color: #F67311;">
                            约{{=String(it.predict_income).replace(/([0-9]+\.[0-9]{0,2})[0-9]*/, "$1")}}CNY/份
                        </span>
                    </p>
                </li>
                <li>
                    <p>
                        <span>
                            单份金额:
                        </span>
                        <span style="color: #F67311;">
                            {{=it.unitCnynew}} CNY / {{=it.unitUsdtnew}} USDT
                        </span>
                    </p>
                    <p style="width: auto;">
                    </p>
                </li>
            </ul>
            <div class="showsuanlibao showclass{{=index}}" style="display:none;">
                <p class="inputBox" style="margin-top: 0.14rem;">
                    <input type="checkbox" class="inputChecked showclass{{=index}}" data-inputName="checkbaozhangrate{{=index}}" data-calssName="chooseMachine{{=index}}" value="checksuanlibao" name="chooseOutcoin"
                        id="checksuanlibao{{=index}}">
                    <label for="checksuanlibao{{=index}}">
                        加配算力宝，收益享保障
                    </label>
                    <img src="../../image/iconshiyixasd.png" style="width: 0.3rem;margin-left: 0.2rem;" class="showDailogone"> 
                </p>
                <p class="inputBox checkbaozhangrate{{=index}}"  style="margin-top: 0.14rem;display:none;">
                    <input type="checkbox" class="inputChecked showclass{{=index}}" data-calssName="chooseMachine{{=index}}" value="baozhangrate" name="chooseOutcoinnew"
                        id="checkbaozhangrate{{=index}}">
                    <label for="checkbaozhangrate{{=index}}">
                        达到保障率，委托自动卖币
                    </label>
                    <img src="../../image/iconshiyixasd.png" style="width: 0.3rem;margin-left: 0.2rem;" class="showDailogtwo">
                </p>
            </div>
            <div class="scriptureMachinenew">
                <div>
                    <p>
                        剩余算力: <span>{{=it.num_leftTotalPower}}T</span>
                    </p>
                    <p>
                        开挖时间: <span>{{=it.time_income}}</span>
                    </p>
                </div>
            </div>
            <div class="changeChoosenew showclass{{=index}}" style="display:none;">
                <p>
                    置换份额
                </p>
                <div>
                    <p class="moneyDischare moneyDischarenew{{=index}}" style="display:none;">
                        差价不得高于3000 CNY
                    </p>
                    <p class="chooseNumnew" >
                        <span class="disButtonnew"  data-calssName="chooseMachine{{=index}}">
                            －
                        </span>
                        <input type="tel" name="lowermachine" value="1"  data-calssName="chooseMachine{{=index}}" oninput="this.value=this.value.replace(/\D/g, '')">
                        <span class="addButtonnew" data-calssName="chooseMachine{{=index}}">
                            ＋
                        </span>
                    </p>
                </div>
            </div>
        </div>
    </li>
    {{~}}
</script>

</html>